package pers.cnzdy.tutorial.Chapter5_UI.Section8_Fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import pers.cnzdy.tutorial.R;


public class KPointDetailFragment extends Fragment {
    View view;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.fragment_kpoint_detail, container, false);
        return view;
    }

    public void refresh(String kpointCaption, String kpointDetail) {
        View visibilityLayout = view.findViewById(R.id.visibility_layout);
        visibilityLayout.setVisibility(View.VISIBLE);

        TextView kpointCaptionText = view.findViewById(R.id.kpoint_caption_frag);
        TextView kpointDetailText = view.findViewById(R.id.kpoint_detail_frag);
        kpointCaptionText.setText(kpointCaption);
        kpointDetailText.setText(kpointDetail);
    }
}